package base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;

/**
 * Moral :
 * Created by 卖火柴的小女孩 on 2018/2/12.
 */

public abstract class BaseActivity<V, T extends BasePresenter<V>> extends FragmentActivity {

    protected T mPresenter;

    //创建Presenter
    protected abstract T createPresenter();

    private Context mBaseContext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBaseContext = this;
        //创建presenter
        mPresenter = createPresenter();
        //绑定VIew
        mPresenter.attachView((V) this);
    }

    public boolean isEmpty(String s){
        if (s == null || "".equals(s))
            return true;
        return false;
    }

}